package com.cicada.cocos2dsamples.samples;

import org.cocos2d.layers.CCLayer;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.nodes.CCSpriteFrame;
import org.cocos2d.nodes.CCTextureCache;
import org.cocos2d.opengl.CCTexture2D;
import org.cocos2d.types.CGPoint;
import org.cocos2d.types.CGRect;
import org.cocos2d.types.CGSize;

public class Collision extends BaseActivity {

	@Override
	public CCLayer getLayer() {
		return new Layer();
	}

	class Layer extends CCLayer {
		public CGSize winSize = CCDirector.sharedDirector().winSize();

		public Layer() {
			addMon1();
		}

		public void addMon1() {

			CCTexture2D deathknight = CCTextureCache.sharedTextureCache()
					.addImage("deadknight.png");

			CCSpriteFrame stand = CCSpriteFrame.frame(deathknight,
					CGRect.make(0, 0, 50, 50), CGPoint.make(0, 0));

			CCSprite sprite = CCSprite.sprite(stand);
			sprite.setPosition(CGPoint.ccp(winSize.getWidth() / 2,
					winSize.getHeight() / 2));
			addChild(sprite);
		}
	}
}
